package com.xdf.ecommerce.feign.hystrix;

import com.xdf.ecommerce.feign.SuredGoodsClient;
import com.xdf.ecommerce.goods.GoodsInfo;
import com.xdf.ecommerce.vo.CommonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * 商品 feign 客户端的熔断降级策略
 * @author chanchaw
 * @create 2025-11-12 7:55
 */
@Slf4j
@Component
public class GoodsClientHystrix implements SuredGoodsClient {
    @Override
    public CommonResponse<List<GoodsInfo>> getGoodsInfo8Id(List<Long> ids) {
        String msg = "进入微服务通信feign客户端SuredGoodsClient的熔断降级策略";
        log.info("进入微服务通信feign客户端SuredGoodsClient的熔断降级策略，查询GoodsInfo的主键是：[{}]", ids);
        return new CommonResponse<>(-1,msg, Collections.emptyList());
    }
}
